from llama_index.core import Settings
from llama_index.llms.openai import OpenAI as DeepSeeK

def deepseek_llm(**kwargs): # llamaIndexOpenai 接口
    llm = DeepSeeK(api_key='sk-79fa0380ce9c4c3297e51451baab0d09',
                 model="deepseek-chat",
                 api_base="https://api.deepseek.com/v1",
                 temperature=0.7,
                 **kwargs)
    return llm
Settings.llm = deepseek_llm()



from llama_index.core.chat_engine import SimpleChatEngine

chat_engine = SimpleChatEngine.from_defaults()
res=chat_engine.chat(message="讲一个关于冰淇淋的笑话")
print(res.response)
